import { getCurrentInstance, computed } from 'vue'
export default (modelValue = 'modelValue') => {
    const instance = getCurrentInstance()
    const { emit, props } = instance

    const computedValue = computed({
        get() {
            return props[modelValue]
        },
        set(value) {
            emit(`update:${modelValue}`, value)
        }
    })

    return computedValue

}